﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Google.GData.Client;
using Google.GData.Extensions;
using Google.YouTube;
using Google.GData.YouTube;
using Google.GData.Extensions.MediaRss;

namespace StudioIt
{
    public partial class StudioIt : Form
    {
        public StudioIt()
        {
            InitializeComponent();

            if (setupYouTube())
            {

            }
            else
            {
                MessageBox.Show("YouTube was not avaible!");
                Environment.Exit(-3);
            }
        }

        

        private Boolean setupYouTube()
        {
            if (getYouTubeRequest(getYouTubeSettings("StudioIt!", developerKey , "mtgTV1337", "GamingFans2019" )) != null)
            {
                return true;
            }

            return false;
        }

        private YouTubeRequestSettings getYouTubeSettings(String Appname, String developerKey,String Username, String Password)
        {
            YouTubeRequestSettings settings = new YouTubeRequestSettings(Appname, developerKey, Username, Password);
            return settings;
        }

        private YouTubeRequest getYouTubeRequest(YouTubeRequestSettings settings)
        {
            YouTubeRequest request = new YouTubeRequest(settings);
            return request; 
        }

        public string developerKey = "AI39si4_ - Tg0XhE0qPHQiCW2xcSPzAqTW_adgL0ZYX7DH_CcZ8Eqm5kSVxMg4bX3OGPby6i2gsd5 - AE8gGVJgWlawbD9BzLomg";

        private void uploadVideo(String titel, String desciption, Boolean Private)
        {
            Video video = new Video() { Title = titel, Description = desciption };

            video.YouTubeEntry.Private = Private;

            video.YouTubeEntry.MediaSource = new MediaFileSource("e:\\test:movie.mov", "video/quicktime");


        }
    }
        
}
